import request from "@/utils/request";

// 角色列表
export function roleLists(params: any) {
  return request.get({ url: "/system/role/list", params });
}

// 角色列表
export function roleAll(params?: any) {
  return request.get({ url: "/system/role/optionselect", params });
}

// 角色列表
export function roleDetail(id: any) {
  return request.get({ url: "/system/role/" + id });
}

// 添加角色
export function roleAdd(params: any) {
  return request.post({ url: "/system/role", params });
}
// 编辑角色
export function roleEdit(params: any) {
  return request.post({ url: "/system/role/edit", params });
}
// 删除角色
export function roleDelete(params: any) {
  return request.post({ url: "/system/role/del", params });
}
/**
 * 获取角色已分配的菜单列表
 * @param id
 * @returns
 */
export function roleMenuTreeselect(id: any) {
  return request.get({ url: "/system/menu/roleMenuTreeselect/" + id });
}

export function authMenu(roleId: any, menus: any) {
  return request.post({
    url: "/system/role/authMenu?roleId=" + roleId,
    params: menus,
  });
}
